const fs = require("graceful-fs");
const path = require("path");
const ncp = require("ncp").ncp;

function deploy() {
    // 删除dis目录
    if (fs.existsSync("dist")) {
        fs.rmdirSync("dist", { recursive: true });
    }
    // 复制文件
    fs.mkdirSync("dist", { recursive: true });
    ncp("src", "dist", function (err) {
        if (err) {
            return console.error(err);
        }
    });
}

deploy();
